toolpath = /home/lhy/arm_linux/tool/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin

cc = ${toolpath}/arm-linux-gnueabihf-gcc
ld = ${toolpath}/arm-linux-gnueabihf-ld
objcopy = ${toolpath}/arm-linux-gnueabihf-objcopy
objdump = ${toolpath}/arm-linux-gnueabihf-objdump


objs := start.o main.o

ledc.bin:$(objs)
	${ld} -Timx6ul.lds -o ledc.elf $^
	${objcopy} -O binary -S ledc.elf $@
	${objdump} -D -m arm ledc.elf > ledc.dis
	
%.o:%.s
	${cc} -Wall -nostdlib -c -O2 -o $@ $<
	
%.o:%.S
	${cc} -Wall -nostdlib -c -O2 -o $@ $<
	
%.o:%.c
	${cc} -Wall -nostdlib -c -O2 -o $@ $<
	
clean:
	rm -rf *.o ledc.bin ledc.elf ledc.dis
	
	
